
#include <stdio.h>
#include <stdlib.h>
#include "write_shmem.h"
#include <string.h>

int main()
{
	char * text = "小说阅读网成立2004年5月，成立之初，就以其独特的风格和丰富的内容受到广大文学小说爱好者的推崇";
	char * subject = "小说阅读网";
	//int res = 1;
	int OK = 1;
	mailinfo * mail = NULL;
	mail = (mailinfo *)malloc(sizeof(mailinfo));
	memset(mail,0,sizeof(mailinfo));
	mail->sorip = 32435344u;
	mail->desip = 23477565u;
	mail->sorport = 3245u;
	mail->desport = 25u;
	mail->mailres = 1u;
	mail->mailsize = strlen(text) + strlen(subject) + 2;
	printf("sorip %u | desip %u | sorport %u | desport %u\n",mail->sorip,mail->desip,mail->sorport,mail->desport);
	printf("mailsize %u | mailres %u\n",mail->mailsize,mail->mailres);
	Create_mail_shmem();
	printf("textlen is %d, subject len is %d\n",strlen(text),strlen(subject));
	OK = write_mail_shmem(mail,subject,text);
	if(OK != 0)
	{
		printf("write_mail_shmem error\n");
	}
	return 0;
}
